//
//  ContactInfoTableCell.m
//  RCA24
//
//  Created by Bogdan Boca on 2/15/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "ContactInfoTableCell.h"

@implementation ContactInfoTableCell

@synthesize cityNameLabel;
@synthesize addressLabel;
@synthesize phoneLabel;
@synthesize faxLabel;
@synthesize emailLabel;

@synthesize callNumberButton;
@synthesize sendEmailButton;

- (void) dealloc
{
    [super dealloc];
    
    [cityNameLabel release];
    [addressLabel release];
    [phoneLabel release];
    [faxLabel release];
    [emailLabel release];
    
    [callNumberButton release];
    [sendEmailButton release];
}

- (void) loadCell
{
    cityNameLabel.text = @"Cluj Napoca";
    addressLabel.text = @"Str Liviu Rebreanu, Nr 9, cod 400446";
    phoneLabel.text = @"Tel: 0264-431907";
    faxLabel.text = @"Fax: 0264431967";
    emailLabel.text = [NSString stringWithFormat: @"office%@rca24.ro", @"@"];
}

- (IBAction) buttonPressed:(id)sender
{
    if(sender == callNumberButton)
    {
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://0264431907"]];
    }
    else if(sender == sendEmailButton)
    {
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"mailto://office@rca24.ro"]];
    }
}

@end
